package com.fannnnn.system.controller;

import com.fannnnn.system.pojo.User;
import com.fannnnn.system.service.impl.LoginServiceImpl;
import com.fannnnn.system.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * \*  Created with IntelliJ IDEA.
 * \*  @author shensifan
 * \*  Date: 2022/1/26
 * \*  Time: 15:29
 * \*  Description:
 * \
 */

@RestController
@RequestMapping("/user")
public class LoginController {


    @Autowired
    LoginServiceImpl loginService;


    @PostMapping("/login")
    public Result login(@RequestBody User user){
        return loginService.login(user);
    }


    @PostMapping("/register")
    public Result register(@RequestBody User user){
        return loginService.register(user);
    }


    @GetMapping("/logout")
    public Result logout(){
        return loginService.logout();
    }
}
